<?php
require('config.php');

        $tiezi_cat=$_REQUEST['tiezi_cat'];
		$sql="select * from `".$oto."_posts_cate` where `name`='{$tiezi_cat}'";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$tiezi_cat_list[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($tiezi_cat_list))
		{
			$cid=$tiezi_cat_list[0]['cid'];
			$sql="select * from `".$oto."_posts`,".$oto."_users where cid='{$cid}' and `status`='1' and isDel='0' and ".$oto."_posts.userId=".$oto."_users.userId order by ftime DESC";
			$result=$db->query($sql);
			while($row=$result->fetch_assoc()){
				$data_list[]=$row;//将取得的所有数据赋值给person_info数组
			}
			if(isset($data_list))
			{
				for($i=0;$i<count($data_list);$i++)
				{
					$data_list[$i]['img_list']=explode("|",$data_list[$i]['img']);
				}
			}
		}
		if(isset($data_list))
		{
			echo json_encode($data_list);
		}
		else
		{
			echo 'null';
		}
		
?>